home *** CD-ROM | disk | FTP | other *** search
Wrap
/* File: InstallerScript.h Contains: Interface file for Version: Technology: Installer 4.5 Package: 4.5 Copyright: © 1984-1998 by Apple Computer, Inc. All rights reserved. Bugs?: If you find a problem with this file, use the Apple Bug Reporter stack. Include the file and version information (from above) in the problem description and send to: Internet: apple.bugs@applelink.apple.com AppleLink: APPLE.BUGS */ #ifndef __INSTALLERSCRIPT__ #define __INSTALLERSCRIPT__ #ifndef __FILES__ #include <Files.h> #endif /* #include <Types.h> */ /* #include <ConditionalMacros.h> */ /* #include <MixedMode.h> */ /* #include <OSUtils.h> */ /* #include <Memory.h> */ /* #include <Patches.h> */ /* #include <Kernel.h> */ /* #include <Errors.h> */ /* #include <MachineExceptions.h> */ /* #include <Timing.h> */ /* #include <OrderedItems.h> */ /* #include <Finder.h> */ #ifndef __MEMORY__ #include <Memory.h> #endif #ifndef __MIXEDMODE__ #include <MixedMode.h> #endif #ifndef __TYPES__ #include <Types.h> #endif #ifdef __cplusplus extern "C" { #endif #if PRAGMA_ALIGN_SUPPORTED #pragma options align=mac68k #endif #if PRAGMA_IMPORT_SUPPORTED #pragma import on #endif enum { kMaxNumOfFunctionParams = 12 }; struct CallBackPBRec { long fSelector; long fResult; long fParam[kMaxNumOfFunctionParams]; }; typedef struct CallBackPBRec CallBackPBRec; typedef CallBackPBRec *CallBackPBPtr; typedef long (*InstallerCallBackProcPtr)(CallBackPBPtr theCallBackPB); #if GENERATINGCFM typedef UniversalProcPtr InstallerCallBackUPP; #else typedef InstallerCallBackProcPtr InstallerCallBackUPP; #endif enum { uppInstallerCallBackProcInfo = kCStackBased | RESULT_SIZE(SIZE_CODE(sizeof(long))) | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(CallBackPBPtr))) }; #if GENERATINGCFM #define NewInstallerCallBackProc(userRoutine) \ (InstallerCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppInstallerCallBackProcInfo, GetCurrentArchitecture()) #else #define NewInstallerCallBackProc(userRoutine) \ ((InstallerCallBackUPP) (userRoutine)) #endif #if GENERATINGCFM #define CallInstallerCallBackProc(userRoutine, theCallBackPB) \ CallUniversalProc((UniversalProcPtr)(userRoutine), uppInstallerCallBackProcInfo, (theCallBackPB)) #else #define CallInstallerCallBackProc(userRoutine, theCallBackPB) \ (*(userRoutine))((theCallBackPB)) #endif /*****************************************************************************************************/ /**/ /* Rule Function*/ /**/ /**/ /* Code Resource Calling Interface:*/ /**/ /* long YourRuleFunction( RuleFunctionPBPtr );*/ /**/ /*****************************************************************************************************/ enum { kTRUERuleFunctionResult = 1, kFALSERuleFunctionResult = 0 }; struct RuleFunctionPBRec { InstallerCallBackUPP fCallBackProcPtr; short fTargetVRefNum; long fTargetFolderDirID; short fSystemVRefNum; long fSystemBlessedDirID; long fRefCon; }; typedef struct RuleFunctionPBRec RuleFunctionPBRec; typedef RuleFunctionPBRec *RuleFunctionPBPtr; /*****************************************************************************************************/ /**/ /* Action Atom Function*/ /**/ /**/ /* Code Resource Calling Interface:*/ /**/ /* long YourActionAtomFunction( ActionAtom2PBPtr );*/ /**/ /*****************************************************************************************************/ enum { before, after, cleanUpCancel }; typedef SInt8 InstallationStage; enum { kActionAtomResultFatalError = -1, kActionAtomResultContinue = 0, kActionAtomResultCancel = 1 }; typedef long ActionAtomResult; struct ActionAtom2PBRec { InstallationStage fMessageID; SInt8 padByte; Handle fStaticDataHdl; InstallerCallBackUPP fCallBackProcPtr; short fTargetVRefNum; long fTargetFolderDirID; short fSystemVRefNum; long fSystemBlessedDirID; long fRefCon; Boolean fDoingInstall; Boolean fDidLiveUpdate; long fInstallerTempDirID; }; typedef struct ActionAtom2PBRec ActionAtom2PBRec; typedef ActionAtom2PBRec *ActionAtom2PBPtr; /*****************************************************************************************************/ /**/ /* Version Compare Function*/ /**/ /**/ /* Code Resource Calling Interface:*/ /**/ /* long YourComputeVersionFunctionSetupFunction( ComputeVersionPBPtr );*/ /**/ /* Return the version in BCD format. For example: ver 2.0.1 final release is 0x02018000*/ /**/ /*****************************************************************************************************/ struct ComputeVersionPB { InstallerCallBackUPP fCallBackProcPtr; }; typedef struct ComputeVersionPB ComputeVersionPB; typedef ComputeVersionPB *ComputeVersionPBPtr; /*****************************************************************************************************/ /**/ /* Target Search Function*/ /**/ /**/ /* Code Resource Calling Interface:*/ /**/ /* SearchResult YourTargetSearchFunction( SearchProcedurePBPtr );*/ /**/ /*****************************************************************************************************/ enum { kFatalSearchError = -1, kSearchSuccessful = 0, kCancelSearchAndInstallation = 1 }; typedef SInt8 SearchResult; struct FoundFileRec { short vRefNum; long parID; Str63 name; short fReferenceID; }; typedef struct FoundFileRec FoundFileRec; typedef FoundFileRec *FoundFileArrayPtr; typedef FoundFileArrayPtr *FoundFileArrayHdl; struct SearchProcedurePBRec { InstallerCallBackUPP fCallBackProcPtr; short fTargetVRefNum; long fTargetFolderDirID; short fSystemVRefNum; long fSystemBlessedDirID; long fRefCon; OSType fFileSpecType; OSType fFileSpecCreator; long fFileSpecCrDate; Str255 fFileSpecPath; FoundFileArrayHdl fFoundFilesArray; }; typedef struct SearchProcedurePBRec SearchProcedurePBRec; typedef SearchProcedurePBRec *SearchProcedurePBPtr; /*****************************************************************************************************/ /**/ /* Setup Function*/ /**/ /**/ /* Code Resource Calling Interface:*/ /**/ /* long YourSetupFunction( EnvironmentSetupPBPtr );*/ /**/ /*****************************************************************************************************/ enum { kContinueInstallerSetup = 0, kQuitInstallerNow = -1 }; struct EnvironmentSetupPB { InstallerCallBackUPP fCallBackProcPtr; FSSpec fTargetFSSpec; short fSystemVRefNum; }; typedef struct EnvironmentSetupPB EnvironmentSetupPB; typedef EnvironmentSetupPB *EnvironmentSetupPBPtr; /*****************************************************************************************************/ /**/ /* Atom Extender Function*/ /**/ /**/ /* Code Resource Calling Interface:*/ /**/ /* long YourAtomExtenderFunction( ExtenderPBPtr );*/ /**/ /*****************************************************************************************************/ enum { kFileAtomDataFork, kFileAtomRsrcFork, kFileAtomRsrcForkFromDataFork, kRsrcAtom, kFontAtom, kActionAtom }; typedef SInt8 DataType; enum { kFatalError = -1, kContinueAsNormal = 0, kCancelInstallation = 1, kCopiedData }; typedef SInt16 ExtenderResultCode; enum { kInitialize, kBeforePart, kAfterPart, kSuccess, kCancel }; typedef SInt8 ExtenderMessageID; struct EnvironsHeaderRec { ExtenderMessageID fMessageID; SInt8 pad1; Handle fStaticDataHdl; InstallerCallBackUPP fCallBackProcPtr; short fTargetVRefNum; long fTargetFolderDirID; short fSystemVRefNum; long fSystemBlessedDirID; long fRefCon; DataType fDataType; SInt8 pad2; }; typedef struct EnvironsHeaderRec EnvironsHeaderRec; struct CopyHeaderRec { FSSpec fSourceFile; FSSpec fTargetFile; long fTotalTargetSize; long fTargetPosStart; long fTargetPartSize; long fSourcePartSize; long fInstallerTempDirID; }; typedef struct CopyHeaderRec CopyHeaderRec; struct BasicCopyRec { EnvironsHeaderRec fEnvironmentHeader; CopyHeaderRec fCopyPBHeader; }; typedef struct BasicCopyRec BasicCopyRec; struct RsrcCopyRec { EnvironsHeaderRec fEnvironmentHeader; CopyHeaderRec fCopyPBHeader; ResType fSourceRsrcType; short fSourceRsrcID; ResType fTargetRsrcType; short fTargetRsrcID; Str255 fTargetRsrcName; short fTargetRsrcAttrs; }; typedef struct RsrcCopyRec RsrcCopyRec; struct FontCopyRec { EnvironsHeaderRec fEnvironmentHeader; CopyHeaderRec fCopyPBHeader; ResType fSourceFontRsrcType; short fSourceFontRsrcID; ResType fTargetFontRsrcType; /* FONT, NFNT, or sfnt*/ short fTargetFontRsrcID; Str255 fTargetFontRsrcName; short fTargetFontRsrcAttrs; Str255 fFamilyName; short fFamilyID; short fFontSize; short fFontStyle; }; typedef struct FontCopyRec FontCopyRec; union ExtenderPBRec { BasicCopyRec fBasicPBRec; BasicCopyRec fFileCopyPBRec; RsrcCopyRec fRsrcCopyPBRec; FontCopyRec fFontCopyPBRec; }; typedef union ExtenderPBRec ExtenderPBRec; typedef ExtenderPBRec *ExtenderPBPtr; /*****************************************************************************************************/ /**/ /* Callback Glue Routines*/ /**/ /*****************************************************************************************************/ /* Memory Related*/ extern pascal Handle INewHandle(InstallerCallBackUPP pCallBackProcPtr, unsigned long newHandleSize); extern pascal void IDisposHandle(InstallerCallBackUPP pCallBackProcPtr, Handle storageHandle); extern pascal void IHLock(InstallerCallBackUPP pCallBackProcPtr, Handle storageHandle); extern pascal void IHUnLock(InstallerCallBackUPP pCallBackProcPtr, Handle storageHandle); /* Atom Extender Related*/ extern pascal OSErr ReadSourceData(InstallerCallBackUPP pCallBackProcPtr, long *count, Ptr storagePtr); extern pascal OSErr WriteTargetData(InstallerCallBackUPP pCallBackProcPtr, long count, Ptr storagePtr); extern pascal OSErr ReadTargetData(InstallerCallBackUPP pCallBackProcPtr, long *count, Ptr storagePtr); extern pascal OSErr SetTargetDataPos(InstallerCallBackUPP pCallBackProcPtr, short positionMode, long positionOffset); extern pascal OSErr GetTargetDataPos(InstallerCallBackUPP pCallBackProcPtr, long *positionOffset); extern pascal OSErr GetTargetDataEOF(InstallerCallBackUPP pCallBackProcPtr, long *theLength); extern pascal OSErr SetSourceDataPos(InstallerCallBackUPP pCallBackProcPtr, short positionMode, long positionOffset); extern pascal OSErr GetSourceDataPos(InstallerCallBackUPP pCallBackProcPtr, long *positionOffset); extern pascal OSErr GetSourceDataEOF(InstallerCallBackUPP pCallBackProcPtr, long *theLength); /* Action Atom Related*/ extern pascal OSErr MakeFSSpecFromFileSpecID(InstallerCallBackUPP pCallBackProcPtr, short pFileSpecID, FSSpec *pFSSpecPtr, StringHandle *pExtraPathInfo); extern pascal void SuspendWaitCursor(InstallerCallBackUPP pCallBackProcPtr); extern pascal void ResumeWaitCursor(InstallerCallBackUPP pCallBackProcPtr); extern pascal void IncrementStatusBar(InstallerCallBackUPP pCallBackProcPtr, short pIncrementAmount); extern pascal Boolean IsUserInteractionAllowed(InstallerCallBackUPP pCallBackProcPtr); extern pascal OSErr InstallerFindSpecialFolder(InstallerCallBackUPP pCallBackProcPtr, short pVRefNum, OSType pfolderType, Boolean pCreateFolder, short *pFoundVRefNum, long *pFoundDirID); extern pascal long GetBoxFlagOverwrite(InstallerCallBackUPP pCallBackProcPtr); extern pascal Boolean IsLaunchedByUpgrader(InstallerCallBackUPP pCallBackProcPtr); extern pascal Boolean IsParasiteScript(InstallerCallBackUPP pCallBackProcPtr); extern pascal void RegisterScriptAction(InstallerCallBackUPP pCallBackProcPtr, short actionClassID, short actionIdentifier, void *param0, void *param1, void *param2, void *param3, void *resultPtr); /*****************************************************************************************************/ /**/ /* Obsolete Interfaces*/ /**/ /*****************************************************************************************************/ /* Old Action Atom Parameter Block*/ struct AAPBRec { short targetVRefNum; long blessedDirID; long aaRefCon; Boolean doingInstall; InstallationStage whichStage; Boolean didLiveUpdate; SInt8 padByte; long installerTempDirID; }; typedef struct AAPBRec AAPBRec; typedef AAPBRec *AAPBRecPtr; /* Action Handler Parameter Block*/ struct ActionHandlerPB { Handle fStaticDataHdl; InstallerCallBackUPP fCallBackProcPtr; short fTargetVRefNum; long fTargetFolderDirID; short fSystemVRefNum; long fSystemBlessedDirID; short fActionClassID; short fActionIdentifier; void *fParam0; void *fParam1; void *fParam2; void *fParam3; void *fResultPtr; }; typedef struct ActionHandlerPB ActionHandlerPB; typedef ActionHandlerPB *ActionHandlerPBPtr; #if PRAGMA_IMPORT_SUPPORTED #pragma import off #endif #if PRAGMA_ALIGN_SUPPORTED #pragma options align=reset #endif #ifdef __cplusplus } #endif #endif /* __INSTALLERSCRIPT__ */